package com.ylbh.modules.member.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ylbh.common.pojo.member.dto.RevenueLogDTO;
import com.ylbh.common.pojo.member.dto.select.RevenueLogSelectDTO;
import com.ylbh.common.pojo.member.vo.IntegralOrderVO;
import com.ylbh.common.pojo.member.vo.RevenueLogDetailsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *
 *
 * @author ${author}
 * @email ${email}
 * @date 2019-04-15 15:35:45
 */
@Mapper
public interface RevenueLogMapper extends BaseMapper<RevenueLogDTO> {
    /**
     * 添加购物券日志
     * @param revenueLogDTO
     * @return
     */
    @Override
    int insert (RevenueLogDTO revenueLogDTO);

    /**
     * 购物券修改日志列表总数
     * @param params
     * @return
     */
//    int getRevenueLogCount(RevenueLogSelectDTO params);

    /**
     * 购物券修改日志列表
     * @param params
     * @return
     */
    List<RevenueLogDTO> selectRevenueLogList(@Param(value = "params") RevenueLogSelectDTO params, Page page);

    /**
     * 用户现有券数量
     * @param name
     * @return
     */
    Integer selectExistingCoupons(String name);

    /**
     * 系统管理购物券明细
     * @param params
     * @param page
     * @return
     */
    List<RevenueLogDTO> selectAdminIntegralLogList(@Param(value = "params") RevenueLogSelectDTO params, Page page);

    /**
     * 购物券明细详情
     * @param id
     * @return
     */
    RevenueLogDetailsVO selectRevenueLogDetails(Long id);

    /**
     * 根据类型和单号查询出订单信息
     * @param relationNo
     * @param type
     * @return
     */
    List<IntegralOrderVO> selectOrderByTypeOrOrderNo(String relationNo, int type);
}
